import React from 'react'
import { Button, Result } from 'antd'
import { useNavigate } from 'react-router-dom'
import { getCache } from '@/utils/session'

export default function NotFound(){
    let homeRoute = getCache('home');
    const navigate = useNavigate();
    const goBack = () => {
        navigate(homeRoute.redirect || homeRoute.path)
    }
    return (
        <div>
            <Result
                status='404'
                title="404"
                subTitle="Not Found"
                extra={<Button type='primary' onClick={goBack}>返回首页</Button>}
            />
        </div>
    )
}
